<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.prime.com.tr/ui"
    template="/WEB-INF/templates/template.xhtml">
    
  <ui:define name="title">Auto Complete</ui:define>
  
  <ui:define name="body">
	  <h:form >
		<fieldset><legend>Simple AutoComplete</legend>
			<h:outputLabel value="Name:" for="simple-autocomplete" />
	  		<p:autoComplete id="simple-autocomplete"
	  			value="#{autoCompleteMB.name}" 
	  			completeMethod="#{autoCompleteMB.simpleAutoComplete}"/>
		</fieldset>		  		  		  		  	
	  </h:form>
	  
	  <h:form >
		<fieldset><legend>Bean AutoComplete</legend>
			<h:outputLabel value="Name:" for="bean-autocomplete" />
	  		<p:autoComplete id="bean-autocomplete"
	  			value="#{autoCompleteMB.person}"
	  			var="person"
	  			itemLabel="#{person.name}"
	  			itemValue="#{person}" 
	  			completeMethod="#{autoCompleteMB.beanAutoComplete}"
	  			onSelectUpdate="person-id"
	  			/>
	  		<h:outputText value="#{autoCompleteMB.person.id}" id="person-id"/>
	  		<h:commandButton  value="Submit" />
		</fieldset>		  		  		  		  	
	  </h:form>	  					
  </ui:define>
</ui:composition>